<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html lang="en" class="no-js">
<% 
	String path=request.getContextPath();
%>
<head>

<meta charset="utf-8">
<title>登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- CSS -->

<link rel="stylesheet" href="<%=path%>/static/css/333.css">
<link rel="stylesheet" href="<%=path%>/static/css/222.css">
<link href="<%=path%>/static/css/111.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
	<script src="<%=path%>/static/js/111.js"></script>
<![endif]-->
<script src="<%=path%>/static/js/333.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/222.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/888.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/444.js"></script>
</head>

<body>
<img style="width: 100%;height: 750px;" src="<%=path%>/static/images/backgrounds/7deb02a9194a4960a987df915ac1186e.jpeg">
<div class="page-container">
	<div class="main_box">
		<div class="login_box">
			<div class="login_logo">
				<%-- <img src="<%=path%>/static/images/logo.png" > --%>
			</div>
		
			<div class="login_form">
				<form action="<%=request.getContextPath() %>/UserinfoServlet?action=login" id="myfrom" method="post">
					<div class="form-group">
						<label  for="j_username" class="t" name="Username">账  号：</label> 
						<input id="email" value="" name="username" type="text" class="form-control x319 in" 
						autocomplete="off"><span id="err"></span>
					</div>
					<div class="form-group">
						<label for="j_password" class="t" name="password">密　码：</label> 
						<input id="password" value="" name="password" type="password" 
						class="password form-control x319 in">
					</div>
					<div class="form-group">
						<label for="j_captcha" class="t">验证码：</label>
						 <input id="code" name="code" type="text" class="form-control x164 in">
						<img id="codeImg" alt="点击更换" title="点击更换" src="<%=request.getContextPath() %>/CodeServlet?action=code" class="m">
						<span id="imgErr"></span>
					</div>
					<div class="form-group">
						<label class="t"></label>
						<label for="j_remember" class="m">
						
					</div>
					<div class="form-group space">
						<label class="t"></label>　　　
						<button type="button"  id="subtn" 
						class="btn btn-primary btn-lg">&nbsp;登&nbsp;录&nbsp </button>
						<input id="reigster" type="button" value="&nbsp;注&nbsp;册&nbsp;" class="btn btn-default btn-lg">
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<!-- Javascript -->

<script src="<%=path%>/static/js/666.js"></script>
<script src="<%=path%>/static/js/777.js"></script>
<script src="<%=path%>/static/js/555.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.5.1.min.js"></script>


<script>
$(function(){
	
	$("#reigster").click(function() {
		window.location.href="<%=request.getContextPath()%>/register.jsp";
	})
	
	$("#subtn").click(function(){
		var code=$("#code").val();
	
		$.ajax({
			
		url:"<%=path%>/CodeServlet?action=check",
			data:"code="+code,
			success:function(data){
				
				if(data=="ok"){
					
					$("#imgErr").html("")
					$("#myfrom").submit();
				}
				else{
				$("#imgErr").html("验证失败")	
				$("#code").select();	
				}
			}
		}); 
	})
})

$("#codeImg").click(function(){
	
	$(this).attr("src","<%=request.getContextPath() %>/CodeServlet?action=code&rand="+Math.random())
	
})





  



</script>
</body>
</html>


